package com.yuyou.train.user.vo.req;

import com.yuyou.train.util.bean.ResBoolSimpleInfo;
import com.yuyou.train.util.enums.CommEnums;


public class ReqBehavior {
	
	private ReqBehaviorVideo video;
	
	private ReqBehaviorMusic music;
	
	private ReqBehaviorFile file;
	
	private ReqBehaviorExam exam;
	
	private ReqBehaviorHwComment hwNeedComment;

	private ReqBehaviorHwCommit hwJustCommit;
	
	private ReqBehaviorThought thought;
	
	private ReqBehaviorEnd end;

	
	
	
	
	public static ResBoolSimpleInfo<String> validate(String resourceType, ReqBehavior reqBehavior) {
		ResBoolSimpleInfo<String> res =new ResBoolSimpleInfo<String>();
		if (resourceType.equals(CommEnums.resourceType.video.getValue())) {
			// 数据校验
			ResBoolSimpleInfo<String> resVideo = ReqBehaviorVideo
					.validate(reqBehavior.getVideo());
			if (!resVideo.isSuccess()) {
				res.setSuccess(false);
				res.setMessage(resVideo.getMessage());
				return res;
			}
		} else if (resourceType.equals(CommEnums.resourceType.music.getValue())) {
		} else if (resourceType.equals(CommEnums.resourceType.file.getValue())) {
		} else if (resourceType.equals(CommEnums.resourceType.exam.getValue())) {
			// 数据校验
			ResBoolSimpleInfo<String> resExam = ReqBehaviorExam
					.validate(reqBehavior.getExam());
			if (!resExam.isSuccess()) {
				res.setSuccess(false);
				res.setMessage(resExam.getMessage());
				return res;
			}
		} else if (resourceType.equals(CommEnums.resourceType.hwJustCommit
				.getValue())) {
			// 数据校验
			ResBoolSimpleInfo<String> resHwCommit = ReqBehaviorHwCommit
					.validate(reqBehavior.getHwJustCommit());
			if (!resHwCommit.isSuccess()) {
				res.setSuccess(false);
				res.setMessage(resHwCommit.getMessage());
				return res;
			}
		} else if (resourceType.equals(CommEnums.resourceType.hwNeedComment
				.getValue())) {
			// 数据校验
			ResBoolSimpleInfo<String> resHwComment = ReqBehaviorHwComment
					.validate(reqBehavior.getHwNeedComment());
			if (!resHwComment.isSuccess()) {
				res.setSuccess(false);
				res.setMessage(resHwComment.getMessage());
				return res;
			}
		} else if (resourceType.equals(CommEnums.resourceType.thought
				.getValue())) {
			// 数据校验
			ResBoolSimpleInfo<String> resThought = ReqBehaviorThought
					.validate(reqBehavior.getThought());
			if (!resThought.isSuccess()) {
				res.setSuccess(false);
				res.setMessage(resThought.getMessage());
				return res;
			}
		}

		return ResBoolSimpleInfo.getSuccessInfo();
		
	}
	
	
	
	
	
	
	public ReqBehaviorEnd getEnd() {
		return end;
	}

	public void setEnd(ReqBehaviorEnd end) {
		this.end = end;
	}

	public ReqBehaviorVideo getVideo() {
		return video;
	}

	public void setVideo(ReqBehaviorVideo video) {
		this.video = video;
	}

	public ReqBehaviorMusic getMusic() {
		return music;
	}

	public void setMusic(ReqBehaviorMusic music) {
		this.music = music;
	}

	public ReqBehaviorFile getFile() {
		return file;
	}

	public void setFile(ReqBehaviorFile file) {
		this.file = file;
	}

	public ReqBehaviorExam getExam() {
		return exam;
	}

	public void setExam(ReqBehaviorExam exam) {
		this.exam = exam;
	}

	public ReqBehaviorHwComment getHwNeedComment() {
		return hwNeedComment;
	}

	public void setHwNeedComment(ReqBehaviorHwComment hwNeedComment) {
		this.hwNeedComment = hwNeedComment;
	}

	public ReqBehaviorHwCommit getHwJustCommit() {
		return hwJustCommit;
	}

	public void setHwJustCommit(ReqBehaviorHwCommit hwJustCommit) {
		this.hwJustCommit = hwJustCommit;
	}

	public ReqBehaviorThought getThought() {
		return thought;
	}

	public void setThought(ReqBehaviorThought thought) {
		this.thought = thought;
	}
	
	
	
	
	

}
